//
//  BBECollectionViewCell.swift
//  PictureShow
//
//  Created by apple on 16/4/27.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit
import SDWebImage

class BBECollectionViewCell: UICollectionViewCell {
    
    @IBOutlet weak var imageView: UIImageView!
    
    // 监听属性的改变，模型有值后就给图片赋值
    var pictureModel : BBEPictureModel?{
        
        didSet{
            
            // 取出模型中的图片属性，判断是否有值
            guard let string = pictureModel?.q_pic_url else{
                return
            }
            
            let url = NSURL(string: string)
            
            imageView.sd_setImageWithURL(url, placeholderImage: UIImage(named: "empty_picture"))
        }
    }
    
   
}
